package com.sdsy.config;

import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;


/**
 * 自定义填充字段数据
 *
 * @author yxc
 * @Date 2018/6/23
 */
public class MyMetaObjectHandler extends MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Object object = getFieldValByName("version", metaObject);
        if (null == object) {
            setFieldValByName("version", 1l, metaObject);
        }
    }






    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
